import request from '@/utils/request'

// -------------------------------------------------------------------------------------领料申请接口文档----------------------------------------------------------------------------

// 获取领料申请列表---------------------------------------- 
export function list (params) {
  return request({
    url: '/function/pick/list',
    method: 'get',
    params
  })
}

// 重新申请接口---------------------------------------
export function resubmit (id) {
  return request({
    url: '/function/pick/reapply/' + id,
    method: 'post',
  })
}

// 获取采购申请列表详情 ==> 俩个页面全部通用 ----------------------------------------
export function listDetail (id) {
  return request({
    url: '/function/pick/' + id,
    method: 'get',
  })
}

// 审核流程  ==> 两个页面全部通用 ----------------------------
export function auditDatail (params) {
  return request({
    url: '/function/audit/pick/list',
    method: 'get',
    params
  })
}

//申请领料：获取申请仓库列表----------------------------------------
export function replacementList (params) {
  return request({
    url: '/function/storehouse/list',
    method: 'get',
    params
  })
}
// 申请领料:获取仓库列表，用于反向获取父级id---------------------------------------- 
export function RegionalList (params) {
  return request({
    url: '/function/storehouse/treeselect',
    method: 'get',
    params
  })
}

//申请领料：获取维修单列表----------------------------------------
export function maintainList (params) {
  return request({
    url: '/function/repair/num/list',
    method: 'get',
    params
  })
}
//申请领料：获取保养单列表----------------------------------------
export function upkeepList (params) {
  return request({
    url: '/function/upkeep/task/num/list',
    method: 'get',
    params
  })
}

//申请领料：获取用户列表，审核人和抄送人----------------------------------------
export function getuserlist (data) {
  return request({
    url: '/system/user/list',
    method: 'get',
    params: data
  })
}

//申请领料：获取备件耗材列表----------------------------------------
export function priceAndamounlist (params) {
  return request({
    url: '/function/consumable/base/priceAndAmount/list',
    method: 'get',
    params
  })
}

//添加采购品: 提交接口----------------------------------------
export function add (data) {
  return request({
    url: '/function/pick',
    method: 'post',
    data
  })
}

// -------------------------------------------------------------------------------------与我相关接口文档----------------------------------------------------------------------------

// 获取与我相关列表----------------------------------------
export function listAndMe (params) {
  return request({
    url: '/function/pick/my/list',
    method: 'get',
    params
  })
}

// 审核【按钮】通过或者驳回接口---------------------------------------
export function statusSort (data) {
  return request({
    url: '/function/audit/pick',
    method: 'put',
    data
  })
}
